package com.demo.gulimall.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.demo.gulimall.auth.entity.MemberReceiveAddress;
import com.demo.gulimall.auth.mapper.MemberReceiveAddressMapper;
import com.demo.gulimall.auth.service.MemberReceiveAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * 会员收货地址
 *
 * @author Chen Yuan
 */

@Service
public class MemberReceiveAddressServiceImpl extends ServiceImpl<MemberReceiveAddressMapper, MemberReceiveAddress> implements MemberReceiveAddressService {

    @Autowired
    private MemberReceiveAddressMapper memberReceiveAddressMapper;

    @Override
    public List<MemberReceiveAddress> getAddressByUserId(Long userId) {
        return this.list(new QueryWrapper<MemberReceiveAddress>().eq("member_id", userId));
    }
}
